VERSION 5.00
Begin VB.Form TrayForm 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "TrayForm"
   ClientHeight    =   825
   ClientLeft      =   150
   ClientTop       =   840
   ClientWidth     =   2250
   ControlBox      =   0   'False
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   825
   ScaleWidth      =   2250
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.Image Image1 
      Height          =   240
      Left            =   240
      Picture         =   "TrayForm.frx":0000
      Top             =   120
      Width           =   240
   End
   Begin VB.Menu menupopup 
      Caption         =   "PopupMenu"
      Begin VB.Menu restore 
         Caption         =   "Restaurar"
      End
   End
End
Attribute VB_Name = "TrayForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
    TrayForm.Left = 99999
    TrayForm.Top = 99999
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)

    Static Message As Long
    Static RR As Boolean

    'x is the current mouse location along the x-axis
    Message = x / Screen.TwipsPerPixelX

    If RR = False Then
        RR = True
        Select Case Message
                ' Left double click (This should bring up a dialog box)
            Case WM_LBUTTONDBLCLK
                restore_Click
            Case WM_RBUTTONUP
                Me.PopupMenu menupopup
        End Select
        RR = False
    End If
End Sub

Private Sub restore_Click()
    Main.Show
    TrayIcon.cbSize = Len(TrayIcon)
    TrayIcon.hWnd = Image1
    TrayIcon.uId = vbNull
    'Remove icon for Tray
    Call Shell_NotifyIcon(NIM_DELETE, TrayIcon)
End Sub
